package com.example.loginmybatis.model;


import com.vladmihalcea.hibernate.type.json.JsonBinaryType;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;

/**
 * Copyright © 2021 @author Shu
 * 上海华泉信息科技有限公司
 * https://021hqit.com
 * All rights reserved.
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "operator")
@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
public class Operator extends BaseResource {

    /**
     * 账户名
     */
    private String username;

    private String name;

    /**
     * 省
     */
    private String province;

    /**
     * 市
     */
    private String city;

    private String description;

    @Type(type = "jsonb")
    @Column(columnDefinition = "jsonb")
    private Price price;

    private Double shopSeparateRate;

    private Double operatorRate;

    @Type(type = "jsonb")
    @Column(columnDefinition = "jsonb")
    private List<Brand> brands;

    @Type(type = "jsonb")
    @Column(columnDefinition = "jsonb")
    private List<Funder> funders;
}
